package org.example.dao.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 
 * </p>
 *
 * @author ducai
 * @since 2024-12-21
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("group_members")
public class GroupMembers extends Model<GroupMembers> {

private static final long serialVersionUID=1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 群id
     */
    @TableField("group_id")
    private Integer groupId;

    /**
     * 用户uuid
     */
    @TableField("user_uuid")
    private String userUuid;

    /**
     * 加入时间
     */
    @TableField("joined_at")
    private LocalDateTime joinedAt;

    /**
     * 退出时间
     */
    @TableField("left_at")
    private LocalDateTime leftAt;

    /**
     * socket链接id
     */
    @TableField("socket_id")
    private String socketId;


    public static final String ID = "id";

    public static final String GROUP_ID = "group_id";

    public static final String USER_UUID = "user_uuid";

    public static final String JOINED_AT = "joined_at";

    public static final String LEFT_AT = "left_at";

    public static final String SOCKET_ID = "socket_id";

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
